package com.feihong.txgw.adapter.kaika;

import com.adapter.base.BaseQuickAdapter;
import com.adapter.base.BaseViewHolder;
import com.adapter.base.animation.ScaleInAnimation;
import com.feihong.txgw.R;
import com.feihong.txgw.json.kaika.PhoneNumList;


/**
 * @Author wangziheng
 * @ProjectName txgw_app
 * @ClassName KaikaPhoneNumLiseReAdapter
 * @package com.feihong.txgw.adapter.kaika
 * @data 2018/6/6 18:48
 * @Describe
 * @Change
 */
public class KaikaPhoneNumLiseReAdapter extends BaseQuickAdapter<PhoneNumList.PhoneNumItem,BaseViewHolder> {
    public KaikaPhoneNumLiseReAdapter(int layoutResId) {
        super(layoutResId);
        openLoadAnimation(new ScaleInAnimation(0.8f));
        isFirstOnly(false);
    }

    @Override
    protected void convert(BaseViewHolder helper, PhoneNumList.PhoneNumItem item) {
        helper.setText(R.id.txt_phonenum,item.getPhonenum());
        helper.setText(R.id.txt_phonelocation,item.getRegion_name());
        String icpName = null;
        if("1".contentEquals(item.getIcp_id()))
        {
            icpName = "中国联通";
        }
        else if("2".contentEquals(item.getIcp_id()))
        {
            icpName = "中国移动";
        }
        else if("3".contentEquals(item.getIcp_id()))
        {
            icpName = "中国电信";
        }
        helper.setText(R.id.txt_phonetype,icpName);
    }
}
